package com.xlhj.yucloud.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.annotation.TableField;
import com.xlhj.yucloud.entity.enums.StatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: liucaijing
 * @description: SysMenuInfo
 * @date: 2021/9/9 21:17
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class SysMenuInfo extends BaseEntity {

    private static final long serialVersionUID = -2645164277688777503L;

    /**
     * 菜单名称
     */
    private String menuName;

    /**
     * 父级菜单ID
     */
    private Long parentId;

    /**
     * 显示顺序
     */
    private Integer menuSort;

    /**
     * 路由地址
     */
    private String path;

    /**
     * 组件地址
     */
    private String component;

    /**
     * 菜单类型M:目录;C:菜单;F:按钮
     */
    private String menuType;

    /**
     * 是否显示0:显示;1:隐藏
     */
    private Integer visible;

    /**
     * 权限标识
     */
    private String perms;

    /**
     * 菜单图标
     */
    private String icon;

    /**
     * 状态0:正常;1:停用
     */
    @JSONField(serialzeFeatures = SerializerFeature.WriteEnumUsingToString)
    private StatusEnum status;

    /**
     * 子菜单
     */
    @TableField(exist = false)
    private List<SysMenuInfo> children = new ArrayList<>();

}
